package designMode.iteratorPattern;

import java.util.HashMap;
import java.util.Iterator;

/**
 * @author LIBOFEI
 * @ClassName CafeMennu
 * @description 咖啡厅菜单
 * @date 2020/6/28 09:01
 * @Version 1.0
 **/
public class CafeMenu implements MenuIterator{

    HashMap<String,MenuItem> map = new HashMap<>();

    public CafeMenu(){

    }

    public void addItem(String name,String description,boolean vegetarian,double price){
        MenuItem menuItem = new MenuItem(name,description,vegetarian,price);
        map.put(name,menuItem);
    }

    @Override
    public Iterator<MenuItem> createIterator() {
        return map.values().iterator();
    }
}
